/*
 *    Copyright (c) 2018-2025, boss All rights reserved.
 *
 * Redistribution and use in source and binary forms, with or without
 * modification, are permitted provided that the following conditions are met:
 *
 * Redistributions of source code must retain the above copyright notice,
 * this list of conditions and the following disclaimer.
 * Redistributions in binary form must reproduce the above copyright
 * notice, this list of conditions and the following disclaimer in the
 * documentation and/or other materials provided with the distribution.
 * Neither the name of the boss developer nor the names of its
 * contributors may be used to endorse or promote products derived from
 * this software without specific prior written permission.
 * Author: boss
 */

package com.hopes.bizz.risk.control.entity;

import com.baomidou.mybatisplus.annotation.IdType;
import com.baomidou.mybatisplus.annotation.TableId;
import com.baomidou.mybatisplus.annotation.TableName;
import com.hopes.bizz.risk.common.constant.enums.RiskModDictEnum;
import com.hopes.bizz.risk.common.constant.enums.RiskSysDictEnum;
import com.hopes.boss.admin.api.resolver.DictResolver;
import com.hopes.boss.common.entity.BaseLogicEntity;
import io.swagger.v3.oas.annotations.media.Schema;
import lombok.Data;
import lombok.EqualsAndHashCode;

/**
 * 风险事件
 *
 * @author pig
 * @date 2023-07-19 16:17:44
 */
@Data
@TableName("risk_unit_event")
@EqualsAndHashCode(callSuper = true)
@Schema(description = "风险事件")
public class RiskUnitEventEntity extends BaseLogicEntity {

    private static final long serialVersionUID = 1L;

	/**
	* id
	*/
    @TableId(type = IdType.ASSIGN_ID)
    @Schema(description="id")
    private Long id;

	/**
	* 风险单元标识
	*/
    @Schema(description="风险单元标识")
    private Long riskUnitId;

	/**
	* 作业步骤
	*/
    @Schema(description="作业步骤")
    private String jobStep;

	/**
	* 风险事件
	*/
    @Schema(description="风险事件")
    private String eventName;

	/**
	* 主要后果
	*/
    @Schema(description="主要后果")
    private String majorConsequenceDesc;

	/**
	* 固有风险等级
	*/
    @Schema(description="固有风险等级")
    private Integer riskLevel;

	/**
	* 固有风险值
	*/
    @Schema(description="固有风险值")
    private Integer riskValue;

	/**
	* 固有风险描述
	*/
    @Schema(description="固有风险描述")
    private String riskDesc;

	/**
	* 控制后风险值
	*/
    @Schema(description="控制后风险值")
    private Integer afterRiskValue;

	/**
	* 控制后风险等级
	*/
    @Schema(description="控制后风险等级")
    private Integer afterRiskLevel;

	/**
	* 控制后风险描述
	*/
    @Schema(description="控制后风险描述")
    private String afterRiskDesc;

	/**
	* 辨识数据
	*/
    @Schema(description="辨识数据")
    private String identifyData;

	/**
	* 机构ID
	*/
    @Schema(description="机构ID")
    private Long orgId;

    public String getRiskUnitIdStr() {
        return DictResolver.getItemLabelByValue(RiskModDictEnum.risk_unit, this.riskUnitId);
    }
    public String getRiskLevelStr() {
        return DictResolver.getItemLabelByValue(RiskSysDictEnum.risk_level, this.riskLevel);
    }
    public String getAfterRiskValueStr() {
        return DictResolver.getItemLabelByValue(RiskSysDictEnum.risk_level, this.afterRiskValue);
    }
}
